1. Field of the Invention
This invention relates to the field of simulation, and in particular to the enhancement of a simulator's performance via convergence-detection.
2. Description of Related Art
Simulators are commonly used to determine and/or verify the expected operation of a system, often before the system is built. A description of the system is encoded as a simulation model, along with a description of example initial conditions and subsequent input stimuli that are to be applied to the system. The simulator initializes the model based on the given initial conditions, and then proceeds to apply the sequence of input stimuli to the model. As the initial conditions and subsequent stimuli are applied, the simulator determines the effects of these events on each component within the system, and allows the user to view these effects using, for example, graphic plots of output waveforms, histograms, state diagrams, and the like. By modeling the system and simulating its performance given sample input stimuli, the operation of the system can be determined or verified without having to actually build the system.
Another widespread use of simulators is to determine the effects that might result from proposed changes to a system. The virtual system environment provided by simulators is often necessary, invaluable, and widely used for developing and evaluating proposed additions to a system's architecture. OPNET Technologies, Inc. provides a suite of simulation products to describe a communications system using networking components, technologies, and protocols. Modeling and simulation also allow a user to determine, for example, the effects of potential component failures in the system, and to evaluate the improvements that a proposed fail-safe configuration may provide. Simulations are also considered essential as tools for validating proposals in system environments characterized by heterogeneity, and/or in large-scale topologies. Simulations also allow for a determination of the effects that proposed changes might have to alleviate bottlenecks and other system deficiencies. Such simulations and evaluations are often used to provide a cost versus benefits analysis for determining whether or not a proposed change to the system will provide sufficient benefit to justify the cost of the change. Other prospective applications include deployment of network devices, configuration of devices, test design of new protocols and so on.
In the circuit and system design field, simulators are used to verify the proper operation of an intended design, before the circuit or system is built. A schematic or net-list defines the interconnection of components forming the circuit or system. A user specifies a set of input stimuli, and the simulator propagates the effects of these stimuli through the components to produce a corresponding set of output events. Alternatively, the simulator may be configured to determine a set of input stimuli that achieves a particular goal, such as a set of input stimuli that facilitate an optimal detection of potential faults in the circuit or system.
Because a computer-based simulation of a modeled system or component may consume more, or less, time than the operation of an actual system or component, a virtual time-base is used within a simulator. That is, a user may specify that input events E1, E2, E3, etc. occur at times T1, T2, T3, etc., and the simulator may report output events corresponding to these input events occur at times T1+D1, T2+D2, T3+D3, etc., without regard to the real-time required by the simulator to determine and report the output events. Unless otherwise noted below, the times associated with simulated events correspond to the virtual time-base that is used by the simulator to model events and corresponding outputs, and the term “clock” refers to the time-keeping used to maintain this virtual time-base.
To optimize the performance of a conventional simulator, the simulator is structured to be event-driven. When a specified input event occurs, the components that are directly affected by this input event are reevaluated with this event as an input. If the output of a component changes in response to this reevaluation, the components that are directly affected by this changed output event are reevaluated. This reevaluation of components continues until no further changes occur, that is, until all of the effects of the input event occur, and the system reaches a quiescent state corresponding to this input event. When the system reaches a quiescent state, the simulator is configured to “advance its clock” to the next scheduled input event, because it is known that once the system reaches a quiescent state, it will stay in this quiescent state until something forces a change. In this manner, although an output may be continually produced corresponding to this quiescent period, the simulator is not actually consuming real-time or resources reevaluating the components during this period. Thus, the effective real-time required to perform the simulation is substantially reduced, compared to a simulator that is configured to reevaluate each component at each unit of time. Typically, performance improvements in the order of hundred-fold or thousand-fold can be achieved via an event-driven simulator with quiescent-state advancement of its clock.
Unfortunately, the performance improvements provided by a quiescent-state clock-advance can only be achieved for simulated systems that regularly achieve a quiescent-state. That is, for example, in a typical digital circuit design, the design is configured to achieve a quiescent-state prior to each clock transition, so that an unchanging logic value will be present at each clocked device's input, thereby assuring repeatable and reliable performance. In the simulation of such systems, when the effects of a clock transition are completed and the simulated system is in a quiescent state, the simulation time is advanced to the next clock transition. Many systems, however, rarely achieve a quiescent state. An analog audio system, for example, receives a continuously changing input signal, and produces a continuously changing output signal. Similarly, in a networking system, typically designed for continuous and/or bursty-traffic, the relationship between traffic dynamics and protocol interactions creates unpredictable fluctuations in the system behavior. While simulating these complex systems, the simulators may not reach a quiescent state and, thereby, may incur long run-times to predict the behavior of the actual systems being modeled.